﻿define([

], function () {

    var Model = Backbone.Model.extend({
        list: function (id, callbackOk) {
            send("project/List", { solutionId: id }, null, callbackOk);
        },
        get: function (id, callbackOk) {
            send("project/Get/" + id, null, null, callbackOk);
        },
        create: function (data, callbackOk, callbackError) {
            send("project/Create", data, { type: "POST" }, callbackOk, callbackError);
        },
        getGeoData: function (id, callbackOk) {
            send("project/GetGeoData/" + id, null, null, callbackOk);
        },
        setGeoData: function (geoData, callbackOk, callbackError) {
            send("project/SetGeoData", geoData, { type: "PUT" }, callbackOk, callbackError);
        },
        getGeoAttributes: function (projectId, callbackOk) {
            send("project/GetGeoAttributes", { projectId: projectId }, null, callbackOk);
        },
        duplicate: function (projectId, callbackOk) {
            send("project/Duplicate/" + projectId, null, { type: "POST" }, callbackOk);
        },
        update: function (data, callbackOk) {
            send("project/Update", data, { type: "PUT" }, callbackOk);
        },        
        "delete": function (id, callbackOk) {
            send("project/Delete/" + id, null, { type: "DELETE" }, callbackOk);
        }
    });
    return Model;
});